package allinpay.yun.demo.dto.dic;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * @author: lijin
 * @date: 2018年11月29日
 */
public enum UserState {

    valid(1, "有效"), audit_fail(3, "审核失败"), locked(5, "已锁"), audit_waiting(7, "待审核");

    public Integer value;
    public String description;

    UserState(Integer value, String description) {
        this.value = value;
        this.description = description;


    }

    @JsonCreator
    public static UserState valueOf(Integer value) {
        UserState[] values = UserState.values();
        for (UserState item : values) if (item.value == value.intValue()) return item;
        return null;
    }

    @JsonValue
    public Integer getValue() {
        return value;
    }
}
